/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */

 struct ListNode {
      int val;
      ListNode *next;
      ListNode(int x) : val(x), next(NULL) {}
  };
class Solution {
public:
    ListNode* deleteDuplicates(ListNode* head) {
        if(head == NULL || head->next == NULL){
            return head;
        }
        
        ListNode* Node1 = head;
        ListNode* Node2 = NULL;
        while(Node1->next != NULL){
            if(Node1->val == Node1->next->val){
                Node2=Node1->next->next;
                Node1->next=Node2;
            }else{
                Node1=Node1->next;
            }
        }
    }
};